<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no" />
    <title>vue的css</title>
    <style>
        [v-cloak] {
            display: none;
        }

        .box {
            width: 100px;
            height: 100px;
            background-color: #FF0000;
        }

        .show {
            display: block
        }
    </style>
</head>

<body>
    <div id="app" v-cloak>
        <div :class="{box:isBox}"></div>
        <button type="button" @click="isBox=!isBox">显示/隐藏</button>
        <div :class="['box','show']"></div>
        <div :style="{fontSize:'20px',color:'#FFFFFF',width:'300px',height:'300px',backgroundColor:'#0000FF'}">我是蓝色盒子
        </div>
        <div :style="[baseStyle,fontStyle]">我是数组内联样式</div>
    </div>
    <script src="js/vue.js"></script>
    <script>
        new Vue({
            el: "#app",
            data() {
                return {
                    isBox: true,
                    baseStyle: {
                        width: "200px",
                        height: "200px",
                        backgroundColor: "#00FF00"
                    },
                    fontStyle: {
                        fontSize: "30px",
                        color: "#FF0000"
                    }
                }
            }
        })
    </script>
</body>

</html>